package com.gui;

import com.manage.*;
import com.virtual.Run;
import javax.swing.*;
import java.awt.*;
import java.time.LocalDateTime;

public class MainWindow extends JFrame {
    private Run systemManager;
    private JTabbedPane tabbedPane;
    
    public MainWindow() {
        systemManager = new Run();
        initializeUI();
    }
    
    private void initializeUI() {
        setTitle("班级管理系统");
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setSize(800, 600);
        setLocationRelativeTo(null);
        
        tabbedPane = new JTabbedPane();
        
        // 添加各个功能面板
        tabbedPane.addTab("班级管理", new ClassManagementPanel(systemManager));
        tabbedPane.addTab("小组管理", new GroupManagementPanel(systemManager));
        tabbedPane.addTab("学生管理", new StudentManagementPanel(systemManager));
        tabbedPane.addTab("随机点名", new RandomSelectionPanel(systemManager));
        tabbedPane.addTab("成绩管理", new ScoreManagementPanel(systemManager));
        
        add(tabbedPane);
    }
    
    public static void main(String[] args) {
        SwingUtilities.invokeLater(() -> {
            new MainWindow().setVisible(true);
        });
    }
} 